namespace RealtimeCollabGame.Domain.ValueObjects;

public record BrushSize(int Value)
{
    public static BrushSize Small => new(5);
    public static BrushSize Medium => new(10);
    public static BrushSize Large => new(20);
    
    public static BrushSize Create(int value)
    {
        if (value < 1) throw new ArgumentException("画笔大小必须大于0", nameof(value));
        if (value > 50) throw new ArgumentException("画笔大小不能超过50", nameof(value));
        
        return new BrushSize(value);
    }
    
    public static implicit operator int(BrushSize brushSize) => brushSize.Value;
    
    public override string ToString()
    {
        return Value.ToString();
    }
} 